
package com.mephi.interfaces;


import java.io.FileNotFoundException;
import java.io.IOException;
import com.mephi.exception.InvalidGameFormatException;
import com.mephi.model.Move;
import com.mephi.util.Ext;


/**
 * Interface which describes operations on game, exporting and importing
 * 
 * @author mephisto
 * @since 2011-04-22
 * @param <E> the type which extends Move
 */
public interface ImportExportGame<E extends Move>
{
	/**
	 * 
	 * @param path the path from which game will be imported to set
	 * @return the imported game
	 * 
	 * @throws FileNotFoundException if file won't be found
	 * @throws IOException if some errors occur during I/O operations
	 * @throws InvalidGameFormatException if game format is invalid
	 * @throws IllegalArgumentException if path is null
	 */
	Game<E>  importGame(String path) throws FileNotFoundException, IOException, InvalidGameFormatException;
	
	/**
	 * 
	 * @param game game which will be exported
	 * @param path the path to which it will be exported
	 * @param ext the extension of file to set
	 * 
	 * @throws FileNotFoundException if file will not be found under path
	 * @throws IllegalArgumentException if game or path is/are null
	 */
	void exportGame(Game<Move> game, String path, Ext ext) throws FileNotFoundException;
}
